home *** CD-ROM | disk | FTP | other *** search
- /* TemperatureEngine.c -- application-specific data management */
-
- /* This module contains data structures to access the data in your */
- /* document's file(s). The purpose is to isolate the details of the */
- /* data representation into this module and to provide accessor */
- /* functions for reading/writing logical pieces of the data. */
- /* For your application, you will probably rewrite most of this. */
- /* This module will not be regenerated by AppMaker unless you delete it. */
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <stdlib.h>
-
- #include "Dispatcher.h"
- #include "DDocData.h"
- #include "Globals.h"
- #include "Miscellany.h"
- #include "TemperatureEngine.h"
-
-
- //----------
- TemperatureEngine* NewTemperatureEngine ()
- {
- TemperatureEngine* engine;
-
- engine = (TemperatureEngine*)malloc (sizeof (TemperatureEngine));
- TemperatureEngine_Init (engine);
- SetClassID (engine, classTemperatureEngine);
-
- return engine;
- }
-
- //----------
- void DeleteEngine (
- AMEngine* engine)
- {
- TemperatureEngine_Free ((TemperatureEngine*)engine);
- free (engine);
- }
-
- //----------
- void TemperatureEngine_Init (
- TemperatureEngine* self)
- {
- AMEngine_Init ((AMEngine*) self);
-
- self->super.mFileType = kFileType;
- self->super.mSignature = kSignature;
- }
-
- //----------
- void TemperatureEngine_Free (
- TemperatureEngine* self)
- {
- AMEngine_Free ((AMEngine*) self);
- }
-
- // These are just models for your own data access functions.
- // Replace them with ones that do something useful.
-
- /*----------*/
- DDocData* GetDocData (
- TemperatureEngine* self)
- {
- return NewDDocData ();
- }
-
- //----------
- void InitData (
- AMEngine* engine)
- {
- TemperatureEngine* self = (TemperatureEngine*) engine;
-
- // override to initialize your data structures
- }
-
- //----------
- void DisposeData (
- AMEngine* engine)
- {
- TemperatureEngine* self = (TemperatureEngine*) engine;
-
- // override to dispose your data structures
- }
-
- //----------
- void ReadFile (
- AMEngine* engine)
- {
- TemperatureEngine* self = (TemperatureEngine*) engine;
-
- InitData (engine);
- engine->mDirty = false;
- // override to read from the current file into your data structures
- }
-
- //----------
- void WriteFile (
- AMEngine* engine)
- {
- TemperatureEngine* self = (TemperatureEngine*) engine;
-
- engine->mDirty = false;
- // override to write your data structures to the current file
- }
-